package com.itheima.String;

import java.util.Scanner;

public class DM07_1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println();
        String s = sc.nextLine();
         String[] mgc = {"TMD","SB","tmd","sb"};
         String s2 = s;
        for (int i = 0; i < mgc.length; i++) {
            s2 = s2.replace(mgc[i],"***");
        }

        System.out.println(s2);
    }
}
